import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ContentCommentVO, ContentCommentForm, ContentCommentQuery } from '@/api/business/contentComment/types';

/**
 * 查询统一内容评论列表
 * @param query
 * @returns {*}
 */

export const listContentComment = (query?: ContentCommentQuery): AxiosPromise<ContentCommentVO[]> => {
  return request({
    url: '/business/contentComment/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询统一内容评论详细
 * @param id
 */
export const getContentComment = (id: string | number): AxiosPromise<ContentCommentVO> => {
  return request({
    url: '/business/contentComment/' + id,
    method: 'get'
  });
};

/**
 * 新增统一内容评论
 * @param data
 */
export const addContentComment = (data: ContentCommentForm) => {
  return request({
    url: '/business/contentComment',
    method: 'post',
    data: data
  });
};

/**
 * 修改统一内容评论
 * @param data
 */
export const updateContentComment = (data: ContentCommentForm) => {
  return request({
    url: '/business/contentComment',
    method: 'put',
    data: data
  });
};

/**
 * 删除统一内容评论
 * @param id
 */
export const delContentComment = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/contentComment/' + id,
    method: 'delete'
  });
};
